package com.shensi.api.admin.client.station;

import com.shensi.api.admin.client.fallback.monitor.SysLogininforClientFallBack;
import com.shensi.api.admin.domian.station.dto.AddTeamManagementDto;
import com.shensi.api.admin.domian.station.dto.MemberManagementDto;
import com.shensi.api.admin.domian.station.dto.SyncUserDto;
import com.shensi.common.core.constant.CloudConstant;
import com.shensi.common.core.domain.AjaxResult;
import com.shensi.common.core.page.TableDataInfo;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.validation.Valid;
import java.util.List;


/**
 * @author mao
 */
@FeignClient(
        value = CloudConstant.ADMIN_SERVER,
        fallbackFactory = SysLogininforClientFallBack.class)
@Component
public interface TeamManagementClient {


    @PostMapping("/team/message/addTeam")
    @ApiOperation(value = "新增团队", notes = "新增团队")
    public AjaxResult addTeam(@RequestBody AddTeamManagementDto teamManagement);

    @DeleteMapping("/team/message/deleteTeam/{ids}")
    public AjaxResult deleteTeam(@PathVariable(value = "ids") String ids);

    @PostMapping("/team/message/updateTeam")
    public AjaxResult updateTeam(@RequestBody AddTeamManagementDto teamManagement);

    @GetMapping("/team/message/teamList")
    public TableDataInfo teamList(@RequestParam(value = "district",required = false) Integer district,
                                  @RequestParam(value = "teamName",required = false) String teamName,
                                  @RequestParam(value = "leaderId",required = false) Long leaderId,
                                  @RequestParam(value = "pageNum", required = false) Integer pageNum,
                                  @RequestParam(value = "pageSize",required = false) Integer pageSize,
                                  @RequestParam(value = "beginTime",required = false) String beginTime,
                                  @RequestParam(value = "endTime",required = false) String endTime);

    @PostMapping("/team/message/addMember")
    public AjaxResult addMember(@RequestBody MemberManagementDto memberManagementDto);

    @DeleteMapping("/team/message/deleteMember/{ids}")
    @ApiOperation(value = "删除成员管理", notes = "删除成员管理")
    public AjaxResult deleteMember(@PathVariable("id") String ids);

    @PostMapping("/team/message/updateMember")
    public AjaxResult updateMember(@RequestBody MemberManagementDto memberManagementDto);

    @GetMapping("/team/message/memberList")
    public TableDataInfo memberList(@RequestParam(value = "salesmanId",required = false) Long salesmanId,
                                    @RequestParam(value = "enterpriseId",required = false) Long enterpriseId,
                                    @RequestParam(value = "leader",required = false) String leader,
                                    @RequestParam(value = "salesman",required = false) String salesman,
                                    @RequestParam(value = "pageNum",required = false) Integer pageNum,
                                    @RequestParam(value = "pageSize",required = false) Integer pageSize,
                                    @RequestParam(value = "beginTime",required = false) String beginTime,
                                    @RequestParam(value = "endTime",required = false) String endTime);


    @GetMapping("/team/message/userList")
    public AjaxResult userList(@RequestParam(value = "level",required = false)Integer level);

    @GetMapping("/team/message/getLevelUserSix")
    public AjaxResult getLevelUserSix();



    @GetMapping("/team/message/getRegionalReport")
    public TableDataInfo getRegionalReport( @RequestParam(value = "districtIds", required = false) List<Integer> districtIds,
                                            @RequestParam(value = "beginTime", required = false) String beginTime,
                                            @RequestParam(value = "endTime", required = false) String endTime,
                                            @RequestParam(value = "pageNum") Integer pageNum,
                                            @RequestParam(value = "pageSize")  Integer pageSize,
                                            @RequestParam(value = "sorted",required = false) Integer sorted
    );

    @GetMapping("/team/message/getRegionalReportExport")
    public AjaxResult newSelectStatisticsPayOrderListExport(
             @RequestParam(value = "districtIds", required = false) List<Integer> districtIds,
             @RequestParam(value = "beginTime", required = false) String beginTime,
             @RequestParam(value = "endTime", required = false) String endTime,
             @RequestParam(value = "pageNum") Integer pageNum,
             @RequestParam(value = "pageSize") Integer pageSize,
             @RequestParam(value = "sorted",required = false) Integer sorted

    );

}
